]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: don't assume the connection path is always non-NULL
authorCosimo Cecchi <cosimoc@gnome.org>
Mon, 20 Mar 2017 18:07:47 +0000 (18:07 +0000)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 20 Mar 2017 18:43:50 +0000 (18:43 +0000)
It can be NULL according to the libnm-glib documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=780321

js/ui/status/network.js

index 4f23fd3bc1b53bea1ee6cbfc462422c06b018c61..e86e89fab15d19caefdf2819dd71a0a8925de1dd 100644 (file)
@@ -1362,7 +1362,11 @@ const NMDeviceWireless = new Lang.Class({
         if (!this._device.active_connection)
             return false;
 
-        let connection = this._settings.get_connection_by_path(this._device.active_connection.connection);
+        let connectionPath = this._device.active_connection.connection;
+        if (!connectionPath)
+            return false;
+
+        let connection = this._settings.get_connection_by_path(connectionPath);
         if (!connection)
             return false;